package $PACKAGENAME$;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.supermay.api.common.dto.AjaxResult;
import $REPOSITORY_CLASS$;
import $ENTITY_CLASS$;
import $SERVICE_CLASS$;
import $BEAN_CLASS$;

@Controller
@RequestMapping("$CONTROLLER_URI$")
public class $CONTROLLER$ {
	private static Logger logger = (Logger) LoggerFactory.getLogger($CONTROLLER$.class);

	@Autowired
	private $SERVICE$ service;
	
	@GetMapping("/list")
	@ResponseBody
	AjaxResult list (String wxapplogin_code, String union_id, String open_id) {
		
		logger.debug("GET: $CONTROLLER_URI$/list");
		
	    List<$ENTITY$> entities = service.findAll();
	    List<$BEAN$> beans = new ArrayList<$BEAN$>();
	    for ($ENTITY$ entity : entities) {
	    	beans.add($BEAN$.fromEntity(entity));
	    }
	    
	    return new AjaxResult(true, beans);
	}
}
